DEFINITION MODULE Keypad;

   (* Contains procedures for controlling the calculator keypad. *)


   IMPORT Screen;


   PROCEDURE ConvertKeyToCh ( Key    : INTEGER;
                              VAR Ch : CHAR ) : BOOLEAN;

      (* Convert the object index of Key into it's character value. *)


   PROCEDURE Initialize ();

      (* Initialize the Keypad module. *)


   PROCEDURE ProcessKey (
      Key          : (* IN  *) INTEGER;
      WindowRegion : (* IN  *) Screen.Box;
      ShowKeys     : (* IN  *) BOOLEAN;
      VAR Number   : (* OUT *) ARRAY OF CHAR ) : BOOLEAN;

      (* Process the key just pressed.  This routine returns     *)
      (* true if the key is non-numeric.  If numeric keys have   *)
      (* been pressed immediately prior to the non-numeric key,  *)
      (* Number contains the series of numeric keys concatenated *)
      (* into an ASCII representation of the number.             *)


END Keypad.
